home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / progs / Netobj / CDK / NetObjectsFusionCDK5_97.exe / _SETUP.1 / ExternalPictureComp.nfx (.txt) < prev    next >
Encoding:
Java Class File  |  1997-01-31  |  1.9 KB  |  61 lines

  1. public class ExternalPictureComp extends ComponentApp {
  2.    DDrawPicture cdp;
  3.    String theSource;
  4.    String codebase;
  5.    DAssetManager assetMan;
  6.  
  7.    public String PropertyListener(String var1, String var2, int var3, int var4, IDInspector var5) {
  8.       if (var3 == 1) {
  9.          if (var1.compareTo("Image URL") == 0) {
  10.             return this.theSource;
  11.          }
  12.       } else {
  13.          if (var1.compareTo("Image URL") == 0) {
  14.             this.theSource = var2;
  15.             if (this.theSource.indexOf(":") <= 0) {
  16.                this.theSource = "http://" + this.theSource;
  17.             }
  18.          }
  19.  
  20.          this.cdp.setHTMLBefore("<img src=\"" + this.theSource + "\"><!--");
  21.          this.cdp.setHTMLAfter("-->");
  22.       }
  23.  
  24.       return "";
  25.    }
  26.  
  27.    public void onCopy() {
  28.    }
  29.  
  30.    public String onInstall(DAssetManager var1, String var2) {
  31.       this.assetMan = var1;
  32.       this.codebase = var2;
  33.       return "Picture Loader";
  34.    }
  35.  
  36.    protected void finalize() {
  37.    }
  38.  
  39.    public void onUnInstall(DAssetManager var1) {
  40.    }
  41.  
  42.    public void onPublish(DAssetManager var1, int var2) {
  43.    }
  44.  
  45.    public void onDrop(IDLayout var1, IDRect var2, int var3) {
  46.       if (var3 == 1) {
  47.          this.theSource = "";
  48.          this.cdp = new DDrawPicture();
  49.          this.cdp.SetPositionRect(var2.getLeft(), var2.getTop(), var2.getRight(), var2.getBottom());
  50.          this.cdp.setStretch(2);
  51.          this.cdp.setImageFile(this.codebase + "ExternalPictureComp.gif");
  52.          var1.AddObject(this.cdp);
  53.       }
  54.    }
  55.  
  56.    public void onInspect(CStringArray var1, CStringArray var2) {
  57.       var1.Set("Image URL");
  58.       var2.Set("String\u0000");
  59.    }
  60. }
  61.